<template>
	<yd-layout id='teamTrendDetail' class=''>
		<div class="content">
			<div class="title">{{dataObj.title}}</div>
			<div class="label">
				<!--<div>{{dataObj.pv}}位伙伴已阅</div>-->
				<!--<span></span>-->
				<div class="time">{{dataObj.newTime}}</div>
			</div>
			<div class="c_v_html" v-html="dataObj.content"></div>
		</div>
	</yd-layout>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				dataObj:{}
			}
		},
		created() {
			
			this.$root.id = this.$route.query.id
			this.$root.uuid = (parseInt((parseInt(new Date()-0))/1000))+''+(this.$root.userInfo.me.id||0)
			this.$root.submitEvent({
				kind:1,
			})
			
			this.$store.commit({
				type:'setDataEvent',
				data:{
					kind:1,
					position:0,
					uuid:this.$root.uuid,
					oid:this.$route.query.id,
					uid:this.$root.userInfo&&(JSON.stringify(this.$root.userInfo)!='{}')?this.$root.userInfo.me.id:0
				}
			})
		},
		//销毁实例
		beforeDestroy(){
			this.$root.submitEvent({
				kind:1,
				lastFlg:true
			})
		},
		watch: {

		},
		computed: {

		},
		mounted() {
			document.title='详情'
			console.log()
			this.$root.ajax({
				name: 'article/detail',
				type: 'get',
				params: {
					id: this.$route.query.id
				}
			}).then((d) => {
				d.data.newTime = this.$root.getDate(new Date(d.data.create_time * 1000))
				this.dataObj = Object.assign({},this.dataObj,d.data)
				
				//分享
					if(this.$root.isWeiXin()){
						//分享
						let query = '';
						if(this.$root.config.channel){
						 	query = `params=channelDY2FGoldUrlStrDY${this.$route.name}FGkeyNumDY1FGparamsKey1DYidFGparamsVal1DY${d.data.id}`
						}else{
						 	query = `params=oldUrlStrDY${this.$route.name}FGkeyNumDY1FGparamsKey1DYidFGparamsVal1DY${d.data.id}`
						}
						this.dataObj.title_img = this.$root.config.shareImgLogo
						this.$root.wxShare({
							d:this.dataObj,//分享对象，题目等{title:'',title-img:''}
							query: query,//参数
							desc:this.dataObj.remark//分享详情
						})
					}
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	@import './teamTrendDetail.scss';
</style>